package com.example.haohao.myview;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.example.middle_connect.dealInterface;

//Java基础之—反射（非常重要）
//https://blog.csdn.net/qq_36226453/article/details/82790375
public class ReflectActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reflect);
    }

    public void sleep(View view) {

        showToast(MirrorReflect.ToInvoke_Mirror_Sleep());
    }

    public void showToast(String content) {
        Toast.makeText(ReflectActivity.this, content, Toast.LENGTH_SHORT).show();
    }

    public void cal_add(View view) {
        MirrorReflect.ToInvoke_Mirror_cal(2, 3, new dealInterface() {
            @Override
            public String passResult(String result) {
                Toast.makeText(ReflectActivity.this, result, Toast.LENGTH_SHORT).show();
                return result;
            }
        });
    }
}